import React, { Component } from 'react'
import 'antd/dist/antd.css';
// 引入action对象
export default class Count extends Component {

    add = () => {
        this.props.add(1)
    }
    noadd = () => {
        this.props.noadd(1)
    }
    asyncadd = () => {
        this.props.asyncAdd(1,500)
    }
    render() {
        return (
            <div>
                当前求和为：{this.props.count}
                <button onClick={this.add}>相加</button>
                <button onClick={this.noadd}>相减</button>
                <button onClick={this.asyncadd}>异步相加</button>
            </div>
        )
    }
}
